import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:search_people/utils/img_util.dart';
import 'package:search_people/value/topcolors.dart';

import '../index.dart';

/// hello
class BrifeWidget extends StatelessWidget {
  const BrifeWidget({Key? key, required this.controller}) : super(key: key);
  final PersonDetailController controller;
  @override
  Widget build(BuildContext context) {
    var state = controller.state;
    return Container(
      color: Colors.white,
      padding: EdgeInsets.symmetric(horizontal: 12.r, vertical: 10.r),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Column(
                children: [
                  loadImage(
                    url: controller.state.baseMd?.image,
                    width: 110.r,
                    height: 130.r,
                  ),
                  SizedBox(
                    height: 10.r,
                  ),
                  Text(
                    state.baseMd?.name ?? '',
                    style: TextStyle(
                      color: TopColors.black_33,
                      fontSize: 14.sp,
                    ),
                  )
                ],
              ),
              SizedBox(
                width: 20.r,
              ),
              Expanded(
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    '民族：${state.baseMd?.nation ?? '~'}',
                    '出生年月：${state.baseMd?.birthdayStr ?? '~'}',
                    '年龄：${state.baseMd?.age ?? '~'}岁',
                    '籍贯：${state.baseMd?.region ?? '~'}',
                    '政治面貌：${state.baseMd?.member ?? '~'}',
                    '专业：${state.baseMd?.degree ?? '~'}',
                    '毕业院校：${state.baseMd?.education ?? '~'}',
                  ]
                      .map((e) => Container(
                            height: 20.r,
                            child: Text(
                              e,
                              style: TextStyle(
                                  color: TopColors.black_33, fontSize: 12.sp),
                            ),
                          ))
                      .toList(),
                ),
              ),
            ],
          ),
          SizedBox(
            height: 10.r,
          ),
          Text(
            '现任：${state.baseMd?.currentPosition ?? '~'}',
            style: TextStyle(color: TopColors.black_33, fontSize: 12.sp),
          ),
          SizedBox(
            height: 6.r,
          ),
          BrnExpandableText(
              text: '分工：${state.baseMd?.inCharge ?? '~'}',
            textStyle: TextStyle(color: TopColors.black_33, fontSize: 12.sp),
            maxLines: 3,


          )
        ],
      ),
    );
  }
}
